package com.briup.day16;

import java.util.Map;
import java.util.Set;
import java.util.TreeMap;

public class Test_TreeMap {
    public static void main(String[] args) {
        //多态一个集合对象
        Map<Integer,String> map=new TreeMap<Integer,String>();
        map.put(4,"mary");
        map.put(2,"jack");
        map.put(1,"tom");
        map.put(3,"lucy");
        System.out.println(map);
        Set<Integer> keySet=map.keySet();
        for(Integer key:keySet){
            System.out.println(map.get(key));
        }
    }
}
